package br.com.ecommerce.controller;


import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;

import br.com.ecommerce.entidade.Usuario;

/**
 * Handles requests for the application home page.
 */
@Controller
public class HomeController {
	Usuario usuario;
	
	
	@RequestMapping(value = "/", method = RequestMethod.GET)
	public ModelAndView CarregarHome() {
		
		ModelAndView home = new ModelAndView("home");
			
			if(usuario ==null){
				 usuario = new Usuario("Visitante");
		}
			if(usuario != null){
				usuario.getNome();
				
			}
		
			
		home.addObject("usuario",usuario);
		
		return home ;
		
		
	}
	
}
